import allure
from page_object.roncoo_login import RoncooLogin
from page_element.el_settlement import *
import logging
from utils.timer import sleep
from pytest_assume.plugin import assume



class RecnooPayment(RoncooLogin):

    def payment(self):
        # 前置条件：已登录
        self.roncoo_login()
        with allure.step(f"点击结算管理"):
            self.click(recnoo.recnoo_jsgl)
        with allure.step(f"点击结算记录管理"):
            self.click(recnoo.recnoo_jsjl)
        with allure.step(f"点击打款"):
            self.click(recnoo.recnoo_dk)
        with allure.step(f"输入打款备注"):
            self.send_keys(recnoo.recnoo_dkbz, '通过')
        with allure.step(f"点击提交按钮"):
            self.click(recnoo.recnoo_dkbtn)
            sleep(2)
        with allure.step(f"断言"):
            dy = self.text(recnoo.recnoo_dy)
            assert '打款成功' == dy
